/*
 * @Author: Starfish_DL
 * @Date: 2020-10-28 14:41:36
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-11-06 14:48:21
 * @CurrentVersion: 1.0
 * @Description: 
 */

/**
 * DivideZeroPractice
 */
public class DivideZeroPractice {
    public int x;

    public static void main(String[] args) {
        int y;
        DivideZeroPractice d = new DivideZeroPractice();
        // y=3/d.x;
        // System.out.println(y);
        try {
            y = 3 / d.x;
        } catch (ArithmeticException e) {
            // done: handle exception
            System.out.println("divide by zero error:" + e.getStackTrace());
        } finally {
            System.out.println("program ends ok!");
        }
    }
}